import Main from '@/components/main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/order-blackmail',
    name: 'order-blackmail',
    meta: {
      title: '打单',
      notCache: true
      // icon: 'md-home',
    },
    component: () => import('@/view/order-records/order-blackmail')
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          title: '首页',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/home/home')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/order-records',
    name: 'order-records',
    redirect: '/order-records',
    component: Main,
    meta: {
      title: '订单记录',
    },
    children: [
      {
        path: '/order-records',
        name: 'order-records',
        meta: {
          title: '订单记录',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/order-records/index')
      },
      
    ]
  },
  {
    path: '/full-gift-order',
    name: 'full-gift-order',
    redirect: '/full-gift-order',
    component: Main,
    meta: {
      title: '满赠订单',
    },
    children: [
      {
        path: '/full-gift-order',
        name: 'full-gift-order',
        meta: {
          title: '满赠订单',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/full-gift-order/index')
      }
    ]
  },
  {
    path: '/after-sales-manage',
    name: 'after-sales-manage',
    redirect: '/after-sales-manage',
    component: Main,
    meta: {
      title: '售后管理',
    },
    children: [
      {
        path: '/after-sales-manage',
        name: 'after-sales-manage',
        meta: {
          title: '售后管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/after-sales-manage/index')
      }
    ]
  },
  {
    path: '/product-manage',
    name: 'product-manage',
    redirect: '/product-manage',
    component: Main,
    meta: {
      title: '产品管理',
    },
    children: [
      {
        path: '/product-manage',
        name: 'product-manage',
        meta: {
          title: '产品管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/product-manage/index')
      },
      {
        path: '/add-product',
        name: 'add-product',
        meta: {
          title: '产品管理',
          notCache: true,
          hideInMenu: true,
          // icon: 'md-home',
        },
        component: () => import('@/view/product-manage/add-product')
      },
    ]
  },
  {
    path: '/classification-manage',
    name: 'classification-manage',
    redirect: '/classification-manage',
    component: Main,
    meta: {
      title: '分类管理',
    },
    children: [
      {
        path: '/classification-manage',
        name: 'classification-manage',
        meta: {
          title: '分类管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/classification-manage/index')
      }
    ]
  },
  {
    path: '/agent-manage',
    name: 'agent-manage',
    redirect: '/agent-manage',
    component: Main,
    meta: {
      title: '代理商管理',
    },
    children: [
      {
        path: '/agent-manage',
        name: 'agent-manage',
        meta: {
          title: '代理商管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/agent-manage/index')
      },
      {
        path: '/add-agent',
        name: 'add-agent',
        meta: {
          title: '产品管理',
          notCache: true,
          hideInMenu: true,
          // icon: 'md-home',
        },
        component: () => import('@/view/agent-manage/add-agent')
      },
    ]
  },
  {
    path: '/user-manage',
    name: 'user-manage',
    redirect: '/user-manage',
    component: Main,
    meta: {
      title: '用户管理',
    },
    children: [
      {
        path: '/user-manage',
        name: 'user-manage',
        meta: {
          title: '用户管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/user-manage/index')
      },
      {
        path: '/points-details',
        name: 'points-details',
        meta: {
          title: '积分明细',
          notCache: true,
          hideInMenu:true, 
          // icon: 'md-home',
        },
        component: () => import('@/view/user-manage/points-details')
      },
      {
        path: '/user-promote',
        name: 'user-promote',
        meta: {
          title: '推广明细',
          notCache: true,
          hideInMenu:true, 
          // icon: 'md-home',
        },
        component: () => import('@/view/user-manage/user-promote')
      },
      {
        path: '/user-order',
        name: 'user-order',
        meta: {
          title: '查看订单',
          notCache: true,
          hideInMenu:true, 
          // icon: 'md-home',
        },
        component: () => import('@/view/user-manage/user-order')
      }
    ]
  },
  {
    path: '/advertisement-manage',
    name: 'advertisement-manage',
    redirect: '/advertisement-manage',
    component: Main,
    meta: {
      title: '广告管理',
    },
    children: [
      {
        path: '/advertisement-manage',
        name: 'advertisement-manage',
        meta: {
          title: '广告管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/advertisement-manage/index')
      },
      {
        path: '/advertisement-edit',
        name: 'advertisement-edit',
        meta: {
          title: '发布广告',
          notCache: true,
          hideInMenu:true, 
          // icon: 'md-home',
        },
        component: () => import('@/view/advertisement-manage/advertisement-edit')
      }
    ]
  },
  {
    path: '/freight-manage',
    name: 'freight-manage',
    redirect: '/freight-manage',
    component: Main,
    meta: {
      title: '运费管理',
    },
    children: [
      {
        path: '/freight-manage',
        name: 'freight-manage',
        meta: {
          title: '运费管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/freight-manage/index')
      }
    ]
  },
  {
    path: '/coupon-package',
    name: 'coupon-package',
    redirect: '/coupon-package',
    component: Main,
    meta: {
      title: '优惠券包',
    },
    children: [
      {
        path: '/coupon-package',
        name: 'coupon-package',
        meta: {
          title: '优惠券包',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/coupon-package/index')
      },
      {
        path: '/add-coupon',
        name: 'add-coupon',
        meta: {
          title: '编辑优惠券',
          notCache: true,
          hideInMenu:true, 
          // icon: 'md-home',
        },
        component: () => import('@/view/coupon-package/add-coupon')
      }
    ]
  },
  {
    path: '/marketing-activities',
    name: 'marketing-activities',
    redirect: '/marketing-activities',
    component: Main,
    meta: {
      title: '营销活动',
    },
    children: [
      {
        path: '/marketing-activities',
        name: 'marketing-activities',
        meta: {
          title: '营销活动',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/marketing-activities/index')
      }
    ]
  },
  {
    path: '/merchant-manage',
    name: 'merchant-manage',
    redirect: '/merchant-manage',
    component: Main,
    meta: {
      title: '商户管理',
    },
    children: [
      {
        path: '/merchant-manage',
        name: 'merchant-manage',
        meta: {
          title: '商户管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/merchant-manage/merchant-manage')
      }
    ]
  },
  {
    path: '/invoice-manage',
    name: 'invoice-manage',
    redirect: '/invoice-manage',
    component: Main,
    meta: {
      title: '开票管理',
    },
    children: [
      {
        path: '/invoice-manage',
        name: 'invoice-manage',
        meta: {
          title: '开票管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/invoice-manage/index')
      }
    ]
  },
  {
    path: '/withdrawal-manage',
    name: 'withdrawal-manage',
    redirect: '/withdrawal-manage',
    component: Main,
    meta: {
      title: '提现管理',
    },
    children: [
      {
        path: '/withdrawal-manage',
        name: 'withdrawal-manage',
        meta: {
          title: '提现管理',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/withdrawal-manage/index')
      }
    ]
  },
  {
    path: '/payment-details',
    name: 'payment-details',
    redirect: '/payment-details',
    component: Main,
    meta: {
      title: '支付明细',
    },
    children: [
      {
        path: '/payment-details',
        name: 'payment-details',
        meta: {
          title: '支付明细',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/payment-details/index')
      }
    ]
  },
  {
    path: '/transaction-details',
    name: 'transaction-details',
    redirect: '/transaction-details',
    component: Main,
    meta: {
      title: '交易明细',
    },
    children: [
      {
        path: '/transaction-details',
        name: 'transaction-details',
        meta: {
          title: '交易明细',
          notCache: true
          // icon: 'md-home',
        },
        component: () => import('@/view/transaction-details/index')
      }
    ]
  },
  {
    path: '/system',
    name: 'system',
    meta: {
      title: '系统',
      icon: 'logo-windows'
    },
    component: Main,
    children: [
      {
        path: 'account-manage',
        name: 'account-manage',
        meta: {
          title: '账号管理',
        },
        component: () => import('@/view/system/account-manage/account-manage')
      },
      {
        path: 'add-account',
        name: 'add-account',
        meta: {
          hideInMenu: true,
          title: '添加账号'
        },
        component: () => import('@/view/system/account-manage/add-account')
      },
      {
        path: 'role-permissions',
        name: 'role-permissions',
        meta: {
          title: '角色权限',
        },
        component: () => import('@/view/system/role-permissions/role-permissions')
      },
      {
        path: 'auth',
        name: 'auth',
        meta: {
          title: '菜单管理',
        },
        component: () => import('@/view/system/auth/auth-manage')
      },

      {
        path: 'system-config',
        name: 'system-config',
        meta: {
          title: '系统配置',
         
        },
        component: () => import('@/view/system/system-config/system-config')
      },
    ]
  },

  {
    path: '/403',
    name: 'error_403',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/403.vue')
  },
  {
    path: '/500', 
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
